# Base image for running chaincode example02
FROM	golang:latest
MAINTAINER  Andy Zhang <zch@cn.ibm.com>

RUN   mkdir -p $GOPATH/src/github.com/hyperledger/ \
    && cd $GOPATH/src/github.com/hyperledger/ \
    && git clone --single-branch -b master --d 1 https://github.com/hyperledger/fabric.git

RUN   cd $GOPATH/src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 \
    && go build && cp chaincode_example02 /
ENV   CORE_CHAINCODE_ID_NAME mycc
ENV   CORE_PEER_ADDRESS	peer:7051
CMD   ["/chaincode_example02"]
